<script setup lang='ts'>
defineOptions({
  name: 'Hospitaltable'
})
interface User {
  date: string
  name: string
  address: string
}
const tableData: User[] = [
  {
    date: 'xf001',
    name: '906医院',
    address: '',
  },
]
const emit = defineEmits(['handleSelec'])
const handleSelectionChange = (val: User[]) => {
  const data = {
    val: val,
    name: 'selection',
  }
  emit('handleSelec', data)
}
const clickChange = (val: User[]) => {
  const data = {
    val: val,
    name: 'click',
  }
  emit('handleSelec', data)
}
</script>

<template>
  <div>
    <el-table
      ref="multipleTableRef"
      :data="tableData"
      border
      style="width: 100%"
      @selection-change="handleSelectionChange"
      @row-dblclick="clickChange"
    >
      <el-table-column type="selection" width="55" />
      <el-table-column label="医院编号" width="120">
        <template #default="scope">{{ scope.row.date }}</template>
      </el-table-column>
      <el-table-column property="name" label="名称" width="120" />
      <el-table-column property="address" label="类型" />
      <el-table-column property="address" label="电话" show-overflow-tooltip />
      <el-table-column property="address" label="地址" show-overflow-tooltip />
    </el-table>
  </div>
</template>

<style lang='scss' scoped>

</style>
